package com.dense.kuiniu.floatcabinet.di.module;

import com.dense.kuiniu.floatcabinet.R;
import com.dense.kuiniu.floatcabinet.mvp.contract.QueryContract;
import com.dense.kuiniu.floatcabinet.mvp.model.AuthenticationModel;
import com.dense.kuiniu.floatcabinet.mvp.model.QueryModel;
import com.dense.kuiniu.floatcabinet.mvp.ui.adapter.BookQueryAdapter;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;

import dagger.Module;
import dagger.Provides;

/**
 * @author Administrator
 * @date 2020/11/2
 */
@Module
public class QueryModule {
    private QueryContract.View view;

    public QueryModule(QueryContract.View view) {
        this.view = view;
    }

    @FragmentScope
    @Provides
    public QueryContract.View provideCategoryView() {
        return view;
    }

    @FragmentScope
    @Provides
    public QueryModel provideCategoryModel(IRepositoryManager repositoryManager) {
        return new QueryModel(repositoryManager);
    }

    @FragmentScope
    @Provides
    public AuthenticationModel provideAuthenticationModel(IRepositoryManager repositoryManager) {
        return new AuthenticationModel(repositoryManager);
    }


    @FragmentScope
    @Provides
    public BookQueryAdapter provideQueryAdapter() {
        return new BookQueryAdapter(R.layout.item_book_info);
    }
} 